package com.itmuch.contentcenter.controller.content;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : lxc
 * @date : 2021-07-12
 */
@RestController
@RefreshScope
public class TestController {

    @GetMapping("test-hot")
    @SentinelResource("hot")
    public String testHot(@RequestParam(required = false) String a,
                          @RequestParam(required = false) String b){
        return  a+b;
    }

    @Value("${your.configuration}")
    private String yourconfiguration;

    @GetMapping("config")
    public String getConfiguration(){
        return this.yourconfiguration;
    }
}
